package com.ss.android.wenda.answer.list;

import com.ss.android.common.callback.SSCallback;
import com.ss.android.wenda.model.Answer;

import java.util.Iterator;

final class p implements SSCallback {
    private final k a;

    p(k arg1) {
        this.a = arg1;

    }

    public final Object onCallback(Object[] args) {
        Object v4 = null;
        if(args != null && args.length >= 0 && !this.a.isDestroyed() && this.a.getActivity() != null) {
            String v2 = args[0].toString();
            Iterator v3 = k.a(this.a).b.iterator();
            int v0;
            do {
                if(v3.hasNext()) {
                    if(!android.support.design.a.isTextEquals(v2,((Answer) v3.next()).getAnswerId())) {
                        continue;
                    }
                    v3.remove();
                    v0 = 1;
                }
                else {
                    v0 = 0;
                }
                break;
            }
            while(true);

            if(v0 == 0) {
                return v4;
            }

            if(k.a(this.a).getCount() == 0) {
                this.a.getActivity().finish();
                return v4;
            }

            k.a(this.a).notifyDataSetChanged();
        }

        return v4;
    }
}

